<?php $this->fetch('public/head') ?>
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">新闻分类</li>
            <li class=""><a href="<?php echo url('addcate') ?>">添加分类</a></li>

        </ul>
        <div class="layui-tab-content">

            <hr>

            <form action="" method="post" class="ajax-form">
                <div class="layui-tab-item layui-show">
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th style="width: 15px;"><input type="checkbox" class="check-all"></th>
                            <th style="width: 30px;">ID</th>
                            <th>分类名称</th>
                            <th>排序</th>
                            <th>分类属性</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php foreach($list as $v): ?>
                            <tr>
                                <td><input type="checkbox" name="ids[]" value="<?php echo $v['id'] ?>"></td>
                                <td><?php echo $v['id'] ?></td>
                                <td><?php echo $v['name'] ?></td>
                                <td><?php echo $v['weight'] ?></td>
                                <td><?php
                                    if($v['isen']==1){
                                        echo "英文分类";
                                    }else{
                                        echo "中文分类";
                                    }
                                     ?></td>
                                <td>
                                    <a href="<?php echo url('editcate?id='.$v['id']) ?>" class="layui-btn layui-btn-normal layui-btn-xs">编辑</a>
                                    <a href="<?php echo url('deletecate?id='.$v['id']) ?>" class="layui-btn layui-btn-danger layui-btn-xs ajax-delete">删除</a>
                                </td>
                            </tr>
                        <?php endforeach; ?>
                        </tbody>
                    </table>
                    <!--分页-->
                </div>
            </form>
        </div>
    </div>

<?php $this->fetch('public/script') ?>